%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import plotly as py
#import chart_studio.plotly
import seaborn as sns
import os
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, classification_report,confusion_matrix
from sklearn.utils.multiclass import unique_labels
from sklearn.linear_model import LogisticRegression
import plotly.figure_factory as ff
ufc = pd.read_csv(os.path.join("resources/clean2.csv"))
ufc.head()
import plotly.figure_factory as ff
import numpy as np
# Add histogram data
x1 = ufc.B_Age
x2 = ufc.R_Age
# Group data together
hist_data = [x1, x2]
group_labels = ['B_Age', 'R_Age']
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, bin_size=[0, 5, 10])
fig.show()
import plotly.figure_factory as ff
import numpy as np
# Add histogram data
x1 = ufc.B_Weight
x2 = ufc.R_Weight
# Group data together
hist_data = [x1, x2]
group_labels = ['B_Weight', 'R_Weight']
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, bin_size=[0, 5, 10])
fig.show()
import plotly.figure_factory as ff
import numpy as np
# Add histogram data
x1 = ufc.B_Height
x2 = ufc.R_Height
# Group data together
hist_data = [x1, x2]
group_labels = ['B_Height', 'R_Height']
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, bin_size=[0, 5, 10])
fig.show()
import plotly.figure_factory as ff
import numpy as np
# Add histogram data
x1 = ufc.B_Height
x2 = ufc.R_Height
# Group data together
hist_data = [x1, x2]
group_labels = ['B_Height', 'R_Height']
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, bin_size=[0, 5, 10])
fig.show()
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.B_Age.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"B_Age",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "B_Age",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.R_Age.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"R_Age",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "R_Age",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.B_Height.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"B_Height",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "B_Height",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.R_Height.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"R_Height",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "R_Height",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.B_Weight.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"B_Weight",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "B_Weight",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.R_Weight.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"R_Weight",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "R_Weight",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.winner.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"Who is the winner?",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "Winner",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')
from plotly.offline import download_plotlyjs,init_notebook_mode,plot, iplot
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
temp = ufc.winby.value_counts()
fig = {
"data": [
{
"values": temp.values,
"labels": temp.index,
"domain": {"x": [0, 1]},
"hole": .6,
"type": "pie"
},
],
"layout": {
"title":"Who was the winner of the fight?",
"annotations": [
{
"font": {
"size": 17
},
"showarrow": False,
"text": "Winby",
"x": 0.5,
"y": 0.5
}
]
}
}
iplot(fig, filename='donut')